package springStart;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

import controller.TestController;
import util.spring.SpringUtils;
import webSocket.channel.QQ_ChannelGroup;
import webSocket.service.WebsocketServer;


@ComponentScan(basePackages= {
		"controller.**", 
		"exception.**",
		"service.**",
		"dao.**",

}
)
@ComponentScan(basePackageClasses=QQ_ChannelGroup.class)
@EnableJpaRepositories(basePackages = {"dao.**"})
@EntityScan(basePackages= {"model.**"})
@EnableAutoConfiguration 
public class SpringApplicationStart {
	
	@Bean
	public SpringUtils springUtils() {
		return new SpringUtils();
	}
	
	public static void main(String[] args) {
		SpringApplication.run(SpringApplicationStart.class, args);
		new Thread(new WebsocketServer()).start();
	}
}
